package com.juquan.lpUtils.http

import android.annotation.SuppressLint
import java.security.cert.X509Certificate
import javax.net.ssl.X509TrustManager

/*
 * Created by Administrator on 2017/10/19 0019.
 * <p>
 * 默认信任所有的证书
 * TODO 最好加上证书认证，主流App都有自己的证书
 *
 * @return 默认信任所有的证书
 * TODO 最好加上证书认证，主流App都有自己的证书
 * @return 默认信任所有的证书
 * TODO 最好加上证书认证，主流App都有自己的证书
 * @return
 */
/*
 * 默认信任所有的证书
 * TODO 最好加上证书认证，主流App都有自己的证书
 *
 * @return
 */   class TrustAllCerts : X509TrustManager {
    @SuppressLint("TrustAllX509TrustManager")
    override fun checkClientTrusted(chain: Array<X509Certificate>, authType: String) {
    }

    @SuppressLint("TrustAllX509TrustManager")
    override fun checkServerTrusted(chain: Array<X509Certificate>, authType: String) {
    }

    override fun getAcceptedIssuers(): Array<X509Certificate?> {
        return arrayOfNulls(0)
    }
}